using System;
using System.Linq;
using collision_and_rigid;

namespace game_stuff
{
    public class StunFixStatus
    {
        public float MakeStunTickMulti { get; private set; }

        public float MakeStunTickDecrease { get; private set; }
        public float MakeStunForceMulti { get; private set; }

        public float MakeStunForceDecrease { get; private set; }
        public float TakeStunTickMulti { get; private set; }

        public float TakeStunTickDecrease { get; private set; }
        public float TakeStunForceMulti { get; private set; }

        public float TakeStunForceDecrease { get; private set; }

        public StunFixStatus()
        {
            TakeStunTickMulti = 0f;
            TakeStunForceMulti = 0f;
            MakeStunTickMulti = 0f;
            MakeStunForceMulti = 0f;
            MakeStunTickDecrease = 0f;
            MakeStunForceDecrease = 0f;
            TakeStunTickDecrease = 0f;
            TakeStunForceDecrease = 0f;
        }


        public static StunFixStatus Unit()
        {
            return new StunFixStatus();
        }

        public void PassiveEffectChange(float[] passiveTrait)
        {
            if (!passiveTrait.Any())
            {
                return;
            }

            MakeStunTickMulti = passiveTrait[1];
            MakeStunTickDecrease = passiveTrait[0];
            MakeStunForceMulti = passiveTrait[3];
            MakeStunForceDecrease = passiveTrait[2];
            TakeStunTickMulti = passiveTrait[4];
            TakeStunTickDecrease = passiveTrait[5];
            TakeStunForceMulti = passiveTrait[6];
            TakeStunForceDecrease = passiveTrait[7];
        }

        public string GetDetail()
        {
            return
                $"击退力比:{MathTools.Round(MakeStunForceMulti, 2)} 击晕时间比:{MathTools.Round(MakeStunTickMulti, 2)} 被击力比:{MathTools.Round(TakeStunForceMulti, 2)} 被击晕时间比:{MathTools.Round(TakeStunTickMulti, 2)}";
        }
    }
}